package com.ruoyi.irtu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.irtu.mapper.IrtuFirmwareMapper;
import com.ruoyi.irtu.domain.IrtuFirmware;
import com.ruoyi.irtu.service.IIrtuFirmwareService;

/**
 * 固件Service业务层处理
 * 
 * @author wb
 * @date 2023-03-05
 */
@Service
public class IrtuFirmwareServiceImpl implements IIrtuFirmwareService 
{
    @Autowired
    private IrtuFirmwareMapper irtuFirmwareMapper;

    /**
     * 查询固件
     * 
     * @param firmwareId 固件主键
     * @return 固件
     */
    @Override
    public IrtuFirmware selectIrtuFirmwareByFirmwareId(Long firmwareId)
    {
        return irtuFirmwareMapper.selectIrtuFirmwareByFirmwareId(firmwareId);
    }

    /**
     * 查询固件列表
     * 
     * @param irtuFirmware 固件
     * @return 固件
     */
    @Override
    public List<IrtuFirmware> selectIrtuFirmwareList(IrtuFirmware irtuFirmware)
    {
        return irtuFirmwareMapper.selectIrtuFirmwareList(irtuFirmware);
    }

    /**
     * 新增固件
     * 
     * @param irtuFirmware 固件
     * @return 结果
     */
    @Override
    public int insertIrtuFirmware(IrtuFirmware irtuFirmware)
    {
        irtuFirmware.setCreateTime(DateUtils.getNowDate());
        return irtuFirmwareMapper.insertIrtuFirmware(irtuFirmware);
    }

    /**
     * 修改固件
     * 
     * @param irtuFirmware 固件
     * @return 结果
     */
    @Override
    public int updateIrtuFirmware(IrtuFirmware irtuFirmware)
    {
        irtuFirmware.setUpdateTime(DateUtils.getNowDate());
        return irtuFirmwareMapper.updateIrtuFirmware(irtuFirmware);
    }

    /**
     * 批量删除固件
     * 
     * @param firmwareIds 需要删除的固件主键
     * @return 结果
     */
    @Override
    public int deleteIrtuFirmwareByFirmwareIds(Long[] firmwareIds)
    {
        return irtuFirmwareMapper.deleteIrtuFirmwareByFirmwareIds(firmwareIds);
    }

    /**
     * 删除固件信息
     * 
     * @param firmwareId 固件主键
     * @return 结果
     */
    @Override
    public int deleteIrtuFirmwareByFirmwareId(Long firmwareId)
    {
        return irtuFirmwareMapper.deleteIrtuFirmwareByFirmwareId(firmwareId);
    }
}
